<?php $this->load->view("partial/header"); ?>
<script type="text/javascript">
$(document).ready(function() 
{ 
    init_table_sorting();
    enable_select_all();
    enable_checkboxes();
    enable_row_selection();
    enable_search('<?php echo site_url("$controller_name/suggest")?>','<?php echo $this->lang->line("common_confirm_search")?>');
    enable_delete('<?php echo $this->lang->line($controller_name."_order_confirm_delete")?>','<?php echo $this->lang->line($controller_name."_order_none_selected")?>');
       
}); 

function init_table_sorting()
{
	//Only init if there is more than one row
	if($('.tablesorter tbody tr').length >1)
	{
		$("#sortable_table").tablesorter(
		{ 
			sortList: [[1,0]], 
			headers: 
			{ 
				0: { sorter: false}, 
				7: { sorter: false} 
			} 

		}); 
	}
}

function post_item_form_submit(response)
{
	if(!response.success)
	{
		set_feedback(response.message,'error_message',true);	
	}
	else
	{
		do_search(true,function()
		{
			//highlight new row
			hightlight_row(response.item_id);
			set_feedback(response.message,'success_message',false);		
		});
	}
}

function post_bulk_form_submit(response)
{
	if(!response.success)
	{
		set_feedback(response.message,'error_message',true);	
	}
	else
	{
		var selected_item_ids=get_selected_values();
		for(k=0;k<selected_item_ids.length;k++)
		{
			update_row(selected_item_ids[k],'<?php echo site_url("$controller_name/get_row")?>');
		}
		set_feedback(response.message,'success_message',false);	
	}
}
</script>

<div id="title_bar">
	<div id="title" class="float_left"><?php echo anchor("$controller_name/",$this->lang->line('common_list_of').' '.$this->lang->line('module_'.$controller_name),array('id'=>'list_of_staff')); ?>&nbsp; > &nbsp;<?php echo $staff_name."'s  ".$this->lang->line('common_account'); ?></div>
	<div id="new_button">
		<table border=0>
			<tr>
				<td>
					<?php echo anchor("$controller_name/view_profile/$staff_id/width:$form_width",
		"<div class='big_button'><span>".$this->lang->line('staffs_profile')."</span></div>",
		array('class'=>'thickbox none','title'=>$this->lang->line('staffs_profile')));
		?>
				</td>
				<td>
					<?php echo anchor("$controller_name/new_payroll/$staff_id/width:$form_width2",
		"<div class='big_button'><span>".$this->lang->line('staffs_new_pay_roll')."</span></div>",
		array('class'=>'thickbox none','title'=>$this->lang->line('staffs_new_pay_roll'),'target'=>'blank'));
		?>		</td>
			</tr>
		</table>
	</div>
</div>
<div id="table_action_header">
	<ul>
		<li class="float_left"><span><?php echo anchor("$controller_name/delete_payroll",$this->lang->line("common_delete"),array('id'=>'delete')); ?></span></li>
		
		<li class="float_right">
		<img src='<?php echo base_url()?>images/spinner_small.gif' alt='spinner' id='spinner' />
		<?php echo form_open("$controller_name/refresh_account/$staff_id",array('id'=>'search_form')); ?>
		</form>
		</li>
	</ul>
</div>
<div id="table_holder">
<?php echo $manage; ?>
</div>
<div id="feedback_bar"></div>
<?php $this->load->view("partial/footer"); ?>